<include target="header.html" />

<load target="./filter/saveListSetting.xml" />
<form action="./" method="post" onsubmit="return procFilter(this, saveListSetting);">
	<fieldset style="display:block">
		<legend style="display:block;">[{$lang->display_items}]</legend>
		<input type="checkbox" id="listSetting_user_name" name="listSetting[]" checked="checked"|cond="in_array('member.user_name', $loginlog_config->listSetting)" value="member.user_name" /> <label for="listSetting_user_name">{$lang->user_name}</label>
		<input type="checkbox" id="listSetting_nick_name" name="listSetting[]" checked="checked"|cond="in_array('member.nick_name', $loginlog_config->listSetting)" value="member.nick_name" /> <label for="listSetting_nick_name">{$lang->nick_name}</label>
		<input type="checkbox" id="listSetting_user_id" name="listSetting[]" checked="checked"|cond="in_array('member.user_id', $loginlog_config->listSetting)" value="member.user_id" /> <label for="listSetting_user_id">{$lang->user_id}</label>
		<input type="checkbox" id="listSetting_email_address" name="listSetting[]" checked="checked"|cond="in_array('member.email_address', $loginlog_config->listSetting)" value="member.email_address" /> <label for="listSetting_email_address">{$lang->email_address}</label>
		<input type="checkbox" id="listSetting_ipaddress" name="listSetting[]" checked="checked"|cond="in_array('loginlog.ipaddress', $loginlog_config->listSetting)" value="loginlog.ipaddress" /> <label for="listSetting_ipaddress">{$lang->ipaddress}</label>
		<input type="checkbox" id="listSetting_date" name="listSetting[]" checked="checked"|cond="in_array('loginlog.regdate', $loginlog_config->listSetting)" value="loginlog.regdate" /> <label for="listSetting_date">{$lang->date}</label>
		<span class="btn button small"><input type="submit" value="{$lang->cmd_save}" /></span>
	</fieldset>
</form>
<div class="search">
	<form action="{Context::getRequestUri()}" method="get" style="float:right;">
		<input type="hidden" name="module" value="admin" />
		<input type="hidden" name="act" value="dispLoginlogAdminList" />
		<select name="search_target">
			<option value="user_id" selected="selected"|cond="$search_target == 'user_id'">{$lang->user_id}</option>
			<option value="user_name" selected="selected"|cond="$search_target == 'user_name'">{$lang->user_name}</option>
			<option value="nick_name" selected="selected"|cond="$search_target == 'nick_name'">{$lang->nick_name}</option>
			<option value="ipaddress" selected="selected"|cond="$search_target == 'ipaddress'">{$lang->ipaddress}</option>
			<option value="member_srl" selected="selected"|cond="$search_target == 'member_srl'">{$lang->member_no}</option>
			<option value="regdate" selected="selected"|cond="$search_target == 'regdate'">{$lang->date}</option>
		</select>
		<input type="text" name="search_keyword" value="{$search_keyword}" class="inputTypeText" />
		<span class="btn button blue"><input type="submit" value="{$lang->cmd_search}" /></span>
		<span class="btn button"><a href="{getUrl('search_target', '', 'search_keyword', '')}">{$lang->cmd_cancle}</a></span>
	</form>
</div>

{@ $column = 2;}
<block cond="in_array('member.user_name', $loginlog_config->listSetting)">
{@
	$listSettingUserName = true;
	$column++;
}
</block>
<block cond="in_array('member.nick_name', $loginlog_config->listSetting)">
{@
	$listSettingNickName = true;
	$column++;
}
</block>
<block cond="in_array('member.user_id', $loginlog_config->listSetting)">
{@
	$listSettingUserId = true;
	$column++;
}
</block>
<block cond="in_array('member.email_address', $loginlog_config->listSetting)">
{@
	$listSettingEmail = true;
	$column++;
}
</block>
<block cond="in_array('loginlog.ipaddress', $loginlog_config->listSetting)">
{@
	$listSettingIP = true;
	$column++;
}
</block>
<block cond="in_array('loginlog.regdate', $loginlog_config->listSetting)">
{@
	$listSettingDate = true;
	$column++;
}
</block>
<!-- 목록 -->
<table cellspacing="0" class="rowTable clear">
<caption>Total {number_format($total_count)}, Page {number_format($page)}/{number_format($total_page)}</caption>
<thead>
	<tr>
		<th><input type="checkbox" /></th>
		<th class="center" scope="col">{$lang->no}</th>
		<th class="center" scope="col">{$lang->category}</th>
		<th scope="col" cond="$listSettingUserName">{$lang->user_name}</th>
		<th scope="col" cond="$listSettingNickName || $listSettingUserId">
			<block cond="$listSettingNickName && $listSettingUserId">
			{$lang->nick_name} ({$lang->user_id})
			</block>
			<block cond="$listSettingNickName && !$listSettingUserId">
			{$lang->nick_name}
			</block>
			<block cond="!$listSettingNickName && $listSettingUserId">
			{$lang->user_id}
			</block>
		</th>
		<th scope="col" cond="$listSettingEmail">{$lang->email_address}</th>
		<th scope="col" cond="$listSettingIP">{$lang->ipaddress}</th>
		<th scope="col" cond="$listSettingDate">{$lang->date}</th>
		<th scope="col">&nbsp;</th>
	</tr>
</thead>
<tbody>
	<tr cond="!$total_count">
		<td colspan="{$column}">로그인 기록이 없습니다.</td>
	</tr>
	<tr loop="$log_list => $no, $log">
		<td><input type="checkbox" name="cart" value="{$log->log_srl}" /></td>
		<td class="number center">{$no}</td>
		<td class="center">
			<strong class="succeed" cond="$log->is_succeed == 'Y'">[{$lang->is_succeed}]</strong>
			<strong class="failed" cond="$log->is_succeed == 'N'">[{$lang->is_failed}]</strong>
		</td>
		<td cond="$listSettingUserName">
			<a href="{getUrl('search_target', 'member_srl', 'search_keyword', $log->member_srl)}">{$log->user_name}</a>
		</td>
		<td cond="$listSettingNickName || $listSettingUserId">
			<block cond="$listSettingNickName && $listSettingUserId">
				<a href="{getUrl('search_target', 'member_srl', 'search_keyword', $log->member_srl)}"><span class="member_{$log->member_srl}">{$log->nick_name}</span> </a>
				<a href="{getUrl('search_target', 'member_srl', 'search_keyword', $log->member_srl)}">({$log->user_id})</a>
			</block>
			<block cond="$listSettingNickName && !$listSettingUserId">
				<span class="member_{$log->member_srl}">{$log->nick_name}</span> <a href="{getUrl('search_target', 'member_srl', 'search_keyword', $log->member_srl)}">[검색]</a>
			</block>
			<block cond="!$listSettingNickName && $listSettingUserId">
				<a href="{getUrl('search_target', 'member_srl', 'search_keyword', $log->member_srl)}">{$log->user_id}</a>
			</block>
		</td>
		<td cond="$listSettingEmail">
			<a href="{getUrl('search_target', 'member_srl', 'search_keyword', $log->member_srl)}">{$log->email_address}</a>
		</td>
		<td cond="$listSettingIP"><a href="{getUrl('search_target', 'ipaddress', 'search_keyword', $log->ipaddress)}">{$log->ipaddress}</a></td>
		<td class="date" cond="$listSettingDate">{zdate($log->regdate, 'Y-m-d H:i:s')}</td>
		<td><a href="{getUrl('act', 'dispLoginlogAdminDeleteLog', 'log_srl', $log->log_srl)}">{$lang->cmd_delete}</a></td>
	</tr>
</tbody>
</table>

<div class="search">
	<div class="pagination a1">
		<a href="{getUrl('page','','module_srl',$module_srl)}" class="prevEnd direction">« {$lang->first_page}</a> 
		<!--@while($page_no = $page_navigation->getNextPage())-->
			<!--@if($page == $page_no)-->
				<strong>{$page_no}</strong> 
			<!--@else-->
				<a href="{getUrl('page',$page_no,'module_srl',$module_srl)}">{$page_no}</a> 
			<!--@end-->
		<!--@end-->
		<a href="{getUrl('page',$page_navigation->last_page,'module_srl',$module_srl)}" class="nextEnd direction">{$lang->last_page} »</a>
	</div>
</div>